package modele;

import java.sql.Date;

public class PreinscriptionSession {

	private int id_session;
	private int id_personne;
	private String prerequis;
	private Date date_inscription;
	private int etat;

	// CONSTRUCTEUR PLEIN
	public PreinscriptionSession(int id_session, int id_personne,
			String prerequis, Date date_inscription, int etat) {
		this.id_session = id_session;
		this.id_personne = id_personne;
		this.prerequis = prerequis;
		this.date_inscription = date_inscription;
		this.etat = etat;
	}

	// CONSTRUCTEUR VIDE
	public PreinscriptionSession() {

	}

	// SETTERS & GETTERS
	public int getId_session() {
		return id_session;
	}

	public void setId_session(int id_session) {
		this.id_session = id_session;
	}

	public int getId_personne() {
		return id_personne;
	}

	public void setId_personne(int id_personne) {
		this.id_personne = id_personne;
	}

	public String getPrerequis() {
		return prerequis;
	}

	public void setPrerequis(String prerequis) {
		this.prerequis = prerequis;
	}

	public PreinscriptionSession(int id_session, int id_personne,
			Date date_inscription, int etat) {
		super();
		this.id_session = id_session;
		this.id_personne = id_personne;
		this.date_inscription = date_inscription;
		this.etat = etat;
	}

	public Date getDate_inscription() {
		return date_inscription;
	}

	public void setDate_inscription(Date date_inscription) {
		this.date_inscription = date_inscription;
	}

	public int getEtat() {
		return etat;
	}

	public void setEtat(int etat) {
		this.etat = etat;
	}

	public String getPrenom() {
		return null;
	}

	@Override
	public String toString() {
		return "Preinscription [id_session=" + id_session + ", id_personne="
				+ id_personne + ", date_inscription=" + date_inscription
				+ ", etat=" + etat + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((date_inscription == null) ? 0 : date_inscription.hashCode());
		result = prime * result + etat;
		result = prime * result + id_personne;
		result = prime * result + id_session;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PreinscriptionSession other = (PreinscriptionSession) obj;
		if (date_inscription == null) {
			if (other.date_inscription != null)
				return false;
		} else if (!date_inscription.equals(other.date_inscription))
			return false;
		if (etat != other.etat)
			return false;
		if (id_personne != other.id_personne)
			return false;
		if (id_session != other.id_session)
			return false;
		return true;
	}

}
